package com.cr.front.system.controller;

import com.cr.common.response.JsonResult;
import com.cr.common.response.PageData;
import com.cr.front.system.pojo.query.SysDictOptionQuery;
import com.cr.front.system.pojo.vo.SysDictOptionVO;
import com.cr.front.system.service.SysDictOptionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "字典项接口")
@RestController
@RequestMapping("/sys/dict/options")
public class SysDictOptionController {

    @Autowired
    private SysDictOptionService sysDictOptionService;

    @ApiOperation(value = "查询字典列表")
    @GetMapping
    public JsonResult list( SysDictOptionQuery query) {
        PageData<SysDictOptionVO> pageData = PageData.page(1, 99, () -> sysDictOptionService.selectList(query));
        return JsonResult.success(pageData);
    }


}
